from meilanblog.lib.base import *

class PostsController(BaseController):
    """REST Controller styled on the Atom Publishing Protocol"""
    # To properly map this controller, ensure your config/routing.py file has
    # a resource setup:
    #     map.resource('post', 'posts')

    def index(self, format='html'):
        """GET /: All items in the collection."""
        # url_for('posts')
        return render_response('index.mako')
    
    def create(self):
        """POST /: Create a new item."""
        # url_for('posts')
        pass
    
    def new(self, format='html'):
        """GET /new: Form to create a new item."""
        # url_for('new_post')
        return render_response('admin/post.mako')
    
    def update(self, id):
        """PUT /id: Update an existing item."""
        # Forms posted to this method should contain a hidden field:
        #    <input type="hidden" name="_method" value="PUT" />
        # Or using helpers:
        #    h.form(h.url_for('post', id=ID), method='put')
        # url_for('post', id=ID)
        pass
    
    def delete(self, id):
        """DELETE /id: Delete an existing item."""
        # Forms posted to this method should contain a hidden field:
        #    <input type="hidden" name="_method" value="DELETE" />
        # Or using helpers:
        #    h.form(h.url_for('post', id=ID), method='delete')
        # url_for('post', id=ID)
        pass
    
    def show(self, id, format='html'):
        """GET /id: Show a specific item."""
        # url_for('post', id=ID)
        pass
    
    def edit(self, id, format='html'):
        """GET /id;edit: Form to edit an existing item."""
        # url_for('edit_post', id=ID)
        pass
    
